import http from '@/utils/http'
const env = import.meta.env
const BASE_URL = env.PROD ? `${env.VITE_API_BASE_URL}/api/v1` : '/api/v1'
const BASE_URL2 = env.PROD ? `${env.VITE_API_BASE_URL2}/api/v1` : '/msapi'

/** @desc 获取所有平台 */
export function getPlatforms() {
  return http.get(`${BASE_URL2}/linkRule/platforms`)
}

/** @desc 源头群 - 列表 */
export function sourceChatRoomList(data: any) {
  return http.get(`${BASE_URL}/sourceChatRoom/list`, data)
}

/** @desc 源头群 - 列表 - 统计 */
export function sourceChatRoomCountShow(data: any) {
  return http.get(`${BASE_URL}/sourceChatRoom/countShow`, data)
}

/** @desc 源头群 - 设置源头群的延时状态 */
export function sourceChatRoomSetDelay(data: any) {
  return http.post(`${BASE_URL}/sourceChatRoom/setDelay`, data)
}

/** @desc 源头群 - 更新 */
export function sourceChatRoomCountUpdate(data: any) {
  return http.post(`${BASE_URL}/sourceChatRoom/update`, data)
}

/** @desc 源头群 - 创建 - 新增 */
export function sourceChatRoomCountCreate(data: any) {
  return http.post(`${BASE_URL}/sourceChatRoom/create`, data)
}

/** @desc 源头群 - 列表 - 搜索 */
export function sourceChatRoomCountSearch(data: any) {
  return http.get(`${BASE_URL}/sourceChatRoom/listForSearch`, data)
}

/** @desc 源头群 - 文案统计列表 */
export function sourceChatRoomCountSenderList(data: any) {
  return http.post(`${BASE_URL}/sourceChatRoom/senderList`, data)
}

/** @desc 源头群 - 文案统计 - 列表 */
export function sourceChatRoomCountCopyrightingList(data: any) {
  return http.post(`${BASE_URL}/sourceChatRoom/message`, data)
}

/** @desc 源头群 - 预览 - 列表 */
export function sourceChatRoomPreviewList(data: any) {
  return http.get(`${BASE_URL}/sourceChatRoom/preview/list`, data)
}

/** @desc 源头群 - 预览 - 列表 */
export function sourceChatRoomPreviewDel(data: any) {
  return http.get(`${BASE_URL}/sourceChatRoom/preview/del`, data)
}

/** @desc 图片上传 */
export function uploadImage() {
  return `${BASE_URL2}/upload/unionActivity`
}

/** @desc 视频上传 */
export function uploadVideo() {
  return `${BASE_URL2}/upload/schoolVideo`
}

/** @desc 源头群 - 统计- 头部 */
export function sourceChatRoomTotalData(data: any) {
  return http.post(`${BASE_URL}/sourceChatRoom/totalData`, data)
}

/** @desc 源头群 - 统计- 线形图 */
export function sourceChatRoomGraphData(data: any) {
  return http.post(`${BASE_URL}/sourceChatRoom/graphData`, data)
}

/** @desc 源头群 - 统计- 出单统计 */
export function sourceChatRoomOrderData(data: any) {
  return http.post(`${BASE_URL}/sourceChatRoom/orderData`, data)
}

/** @desc 源头群 - 统计- 出单统计 */
export function sourceChatRoomUserOrderData(data: any) {
  return http.post(`${BASE_URL}/sourceChatRoom/userOrderData`, data)
}

/** @desc 源头群 - 统计- 出单统计 */
export function wechatListByIds(data: any) {
  return http.post(`${BASE_URL}/user/wechat/listByIds`, data)
}

/** @desc 源头群 - 统计- 出单排行 */
export function sourceChatRoomGoodsRankData(data: any) {
  return http.post(`${BASE_URL}/sourceChatRoom/goodsRankData`, data)
}

/** @desc 源头群 - 统计- 挂单详情排行 */
export function sourceChatRoomUserWechatRankData(data: any) {
  return http.post(`${BASE_URL}/sourceChatRoom/userWechatRankData`, data)
}

/** @desc 源头群 - 统计- 分数排行 */
export function sourceChatRoomScoreRankData(data: any) {
  return http.post(`${BASE_URL}/sourceChatRoom/scoreRankData`, data)
}

/** @desc 源头群 - 统计- 分数排行 */
export function sourceChatRoomRepeatGoodsMessage(data: any) {
  return http.post(`${BASE_URL}/sourceChatRoom/repeatGoodsMessage`, data)
}
